import { Module } from "vuex"
import { RootState } from "@store/index"
export interface UserState {
  userName: string,
  userToken:string
}
interface userObj{
  name: string,
  token: string
}
export const store: Module<UserState, RootState> = {
  namespaced: true,
  state: (): UserState => ({
    userName: "",
    userToken: ''
  }),
  mutations: {
    loginInfo(state: UserState, userInfo:userObj) {
      state.userName = userInfo.name
      state.userToken = userInfo.token
    }
  },
}
